1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gio.TlsClientConnectionIF; 26 27 private import gio.IOStream; 28 private import gio.SocketConnectableIF; 29 private import gio.c.functions; 30 public import gio.c.types; 31 private import glib.ConstructionException; 32 private import glib.ErrorG; 33 private import glib.GException; 34 private import glib.ListG; 35 private import gobject.ObjectG; 36 37 38 /** 39 * #GTlsClientConnection is the client-side subclass of 40 * #GTlsConnection, representing a client-side TLS connection. 41 * 42 * Since: 2.28 43 */ 44 public interface TlsClientConnectionIF{ 45 /** Get the main Gtk struct */ 46 public GTlsClientConnection* getTlsClientConnectionStruct(bool transferOwnership = false); 47 48 /** the main Gtk struct as a void* */ 49 protected void* getStruct(); 50 51 52 /** */ 53 public static GType getType() 54 { 55 return g_tls_client_connection_get_type(); 56 } 57 58 /** 59 * Possibly copies session state from one connection to another, for use 60 * in TLS session resumption. This is not normally needed, but may be 61 * used when the same session needs to be used between different 62 * endpoints, as is required by some protocols, such as FTP over TLS. 63 * @source should have already completed a handshake and, since TLS 1.3, 64 * it should have been used to read data at least once. @conn should not 65 * have completed a handshake. 66 * 67 * It is not possible to know whether a call to this function will 68 * actually do anything. Because session resumption is normally used 69 * only for performance benefit, the TLS backend might not implement 70 * this function. Even if implemented, it may not actually succeed in 71 * allowing @conn to resume @source's TLS session, because the server 72 * may not have sent a session resumption token to @source, or it may 73 * refuse to accept the token from @conn. There is no way to know 74 * whether a call to this function is actually successful. 75 * 76 * Using this function is not required to benefit from session 77 * resumption. If the TLS backend supports session resumption, the 78 * session will be resumed automatically if it is possible to do so 79 * without weakening the privacy guarantees normally provided by TLS, 80 * without need to call this function. For example, with TLS 1.3, 81 * a session ticket will be automatically copied from any 82 * #GTlsClientConnection that has previously received session tickets 83 * from the server, provided a ticket is available that has not 84 * previously been used for session resumption, since session ticket 85 * reuse would be a privacy weakness. Using this function causes the 86 * ticket to be copied without regard for privacy considerations. 87 * 88 * Params: 89 * source = a #GTlsClientConnection 90 * 91 * Since: 2.46 92 */ 93 public void copySessionState(TlsClientConnectionIF source); 94 95 /** 96 * Gets the list of distinguished names of the Certificate Authorities 97 * that the server will accept certificates from. This will be set 98 * during the TLS handshake if the server requests a certificate. 99 * Otherwise, it will be %NULL. 100 * 101 * Each item in the list is a #GByteArray which contains the complete 102 * subject DN of the certificate authority. 103 * 104 * Returns: the list of 105 * CA DNs. You should unref each element with g_byte_array_unref() and then 106 * the free the list with g_list_free(). 107 * 108 * Since: 2.28 109 */ 110 public ListG getAcceptedCas(); 111 112 /** 113 * Gets @conn's expected server identity 114 * 115 * Returns: a #GSocketConnectable describing the 116 * expected server identity, or %NULL if the expected identity is not 117 * known. 118 * 119 * Since: 2.28 120 */ 121 public SocketConnectableIF getServerIdentity(); 122 123 /** 124 * SSL 3.0 is no longer supported. See 125 * g_tls_client_connection_set_use_ssl3() for details. 126 * 127 * Deprecated: SSL 3.0 is insecure. 128 * 129 * Returns: %FALSE 130 * 131 * Since: 2.28 132 */ 133 public bool getUseSsl3(); 134 135 /** 136 * Gets @conn's validation flags 137 * 138 * This function does not work as originally designed and is impossible 139 * to use correctly. See #GTlsClientConnection:validation-flags for more 140 * information. 141 * 142 * Deprecated: Do not attempt to ignore validation errors. 143 * 144 * Returns: the validation flags 145 * 146 * Since: 2.28 147 */ 148 public GTlsCertificateFlags getValidationFlags(); 149 150 /** 151 * Sets @conn's expected server identity, which is used both to tell 152 * servers on virtual hosts which certificate to present, and also 153 * to let @conn know what name to look for in the certificate when 154 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled. 155 * 156 * Params: 157 * identity = a #GSocketConnectable describing the expected server identity 158 * 159 * Since: 2.28 160 */ 161 public void setServerIdentity(SocketConnectableIF identity); 162 163 /** 164 * Since GLib 2.42.1, SSL 3.0 is no longer supported. 165 * 166 * From GLib 2.42.1 through GLib 2.62, this function could be used to 167 * force use of TLS 1.0, the lowest-supported TLS protocol version at 168 * the time. In the past, this was needed to connect to broken TLS 169 * servers that exhibited protocol version intolerance. Such servers 170 * are no longer common, and using TLS 1.0 is no longer considered 171 * acceptable. 172 * 173 * Since GLib 2.64, this function does nothing. 174 * 175 * Deprecated: SSL 3.0 is insecure. 176 * 177 * Params: 178 * useSsl3 = a #gboolean, ignored 179 * 180 * Since: 2.28 181 */ 182 public void setUseSsl3(bool useSsl3); 183 184 /** 185 * Sets @conn's validation flags, to override the default set of 186 * checks performed when validating a server certificate. By default, 187 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used. 188 * 189 * This function does not work as originally designed and is impossible 190 * to use correctly. See #GTlsClientConnection:validation-flags for more 191 * information. 192 * 193 * Deprecated: Do not attempt to ignore validation errors. 194 * 195 * Params: 196 * flags = the #GTlsCertificateFlags to use 197 * 198 * Since: 2.28 199 */ 200 public void setValidationFlags(GTlsCertificateFlags flags); 201 }